package com.tfswue.zqm.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tfswue.zqm.entity.User;
import com.tfswue.zqm.service.Userservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    @Autowired
    private Userservice userservice;

    @RequestMapping("/getUser")
    public User getUser() {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id", 2);

        List<User> list = userservice.list(queryWrapper);
        return userservice.getById(2);
    }
}